// index.js
// 获取应用实例
Component({
	properties: {
		patientList: Array,
		showModalStatus: Boolean,
		pageFlage: String
	},
	data: {
		showModalStatus: false
	}, // 私有数据，可用于模版渲染

	ready: function() {},
	moved: function() {},
	detached: function() {},

	methods: {
		bindPatient: function() {
			console.log(1)
			if (this.properties.pageFlage === '1') {
				wx.navigateTo({
					url: '../../createPatient/index'
				})
			} else {
				wx.navigateTo({
					url: '../createPatient/index'
				})
			}

		},
		hideModal() {
			this.setData({
				showModalStatus: false
			})
		},
		choosePatient(val) {
			this.triggerEvent("bindChangePatient", val.currentTarget.dataset.item)
			this.setData({
				showModalStatus: false
			})
			console.log(this.properties.pageFlage)
			if (this.properties.pageFlage !== '1') {
				console.log(1234)
				wx.setStorageSync('patientInfo', val.currentTarget.dataset.item)
			}
		},
	}

})
